package com.example;

import org.springframework.security.crypto.password.PasswordEncoder;


/**
 * 自定义密码校验
 */
public class CustomPasswordEncoder implements PasswordEncoder {
    @Override
    public String encode(CharSequence charSequence) {
        return charSequence.toString();
    }

    /**
     *
     * @param charSequence  输入的密码
     * @param s 数据库密码
     * @return
     */
    @Override
    public boolean matches(CharSequence charSequence, String s) {
        if (charSequence.equals(s)){
            return true;
        }
        return false;
    }
}
